package xj.model.uml;

import static xj.model.uml.UMLModelConstants.ATTR_CLASS_NAME;

public class UMLObject extends NamedElement {

  public UMLObject() {
    this(null, null);
  }

  public UMLObject(String name) {
    this(name, null);
  }

  public UMLObject(String name, String cname) {
    super(name);
    setClassname(cname);
    destructable = false;
    // preserved = true;
  }

  public String getClassname() {
    return className;
  }

  public void setClassname(String c) {
    className = c;
    setAttribute(ATTR_CLASS_NAME, className);
  }

  @Override
  public Object clone() throws CloneNotSupportedException {
    UMLObject obj = (UMLObject) super.clone();
    obj.setClassname(className);
    return obj;
  }

  protected String className;

}
